package cn.tedu.blog.server.mapper;

import cn.tedu.blog.server.pojo.entity.Article;
import cn.tedu.blog.server.pojo.vo.ArticleAdminDetailVO;
import cn.tedu.blog.server.pojo.vo.ArticleDetailVO;
import cn.tedu.blog.server.pojo.vo.ArticleListItemVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Repository
public interface ArticleMapper {
    /**
     * 根据标题查询文章
     * @param title
     * @return
     */
    ArticleListItemVO getByTitle(String title);

    /**
     * 添加文章
     * @param article
     * @return
     */
   
    int insert(Article article);

    /**
     * 根据id删除文章
     * @param id
     * @return
     */
    int deleteById(long id);
    /**
     * 根据多个id批量删除文章
     * @param ids
     * @return
     */
    int deleteByIds(long... ids);
    /**
     * 根据id修改文章
     * @param
     * @return
     */
    int updateById(Article article);

    /**
     * 根据id查询文章
     * @param id
     * @return
     */
    ArticleDetailVO getById(long id);

    List<ArticleAdminDetailVO> adminSelect();


    List<ArticleAdminDetailVO> adminSelectFind(@Param("page") Page<Object> page, @Param("param") Map<String,Object> map);

    List<ArticleAdminDetailVO> adminSelectFindAll(ArticleAdminDetailVO articleAdminDetailVO);

    int deleteArticleTag(Long id);

    
}
